<template>
  <el-container>
    <el-header>
      <div>疫苗预约后台管理系统</div>
      <div>
        {{username}}
        <el-tooltip content="点击退出"
                    placement="left">
          <el-button type="danger"
                     @click="logout"
                     circle
                     plain
                     icon="el-icon-user-solid"></el-button>
        </el-tooltip>
      </div>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu router
                 text-color="#fff"
                 background-color="#2b4b6b"
                 active-text-color="#409eff">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-s-marketing"></i>
              <span>用户管理</span>
            </template>
            <el-menu-item index="/user">
              <i class="el-icon-date"></i>
              <span>用户管理</span>
            </el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">

              <i class="el-icon-s-cooperation"></i>
              <span>咨询公告管理</span>
            </template>
            <el-menu-item index="/anno">
              <i class="el-icon-s-marketing"></i>
              <span>咨询公告管理</span>
            </el-menu-item>

          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-home"></i>
              <span>医院信息管理</span>
            </template>
            <el-menu-item index="/hospital">
              <i class="el-icon-c-scale-to-original"></i>
              <span>医院管理</span>
            </el-menu-item>

          </el-submenu>
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-s-home"></i>
              <span>疫苗管理</span>
            </template>
            <el-menu-item index="/vaccineSort">
              <i class="el-icon-s-check"></i>
              <span>疫苗种类管理</span>
            </el-menu-item>
            <el-menu-item index="/vaccineInfo">
              <i class="el-icon-s-check"></i>
              <span>疫苗信息管理</span>
            </el-menu-item>

          </el-submenu>
          <el-submenu index="5">
            <template slot="title">
              <i class="el-icon-s-home"></i>
              <span>预约管理</span>
            </template>
            <el-menu-item index="/VaccineOrder">
              <i class="el-icon-s-check"></i>
              <span>预约管理</span>
            </el-menu-item>

          </el-submenu>
          <el-submenu index="6">
            <template slot="title">
              <i class="el-icon-s-home"></i>
              <span>留言箱管理</span>
            </template>
            <el-menu-item index="/msgbox">
              <i class="el-icon-s-check"></i>
              <span>留言箱管理</span>
            </el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view />
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import {clearToken} from "../api/request";

export default {
  data () {
    return {
      username: sessionStorage.getItem("username")
    }
  },
  methods: {
    logout () {
        clearToken()
    }
  }
}
</script>

<style scoped>
.el-header {
  background-color: #2b4b6b;
  display: flex;
  justify-content: space-between;
  padding-left: 10px;
  align-items: center;
  color: white;
  font-size: 18px;
}
.el-aside {
  color: white;
  background-color: #2b4b6b;
}
.el-main {
  background-color: aliceblue;
}
.el-container {
  height: 100%;
}
</style>
